home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  2.7 KB  |  119 lines

  1. /*  fcntl.h
  2.  
  3.     Define flag values accessible to open.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.0
  9.  *
  10.  *      Copyright (c) 1987, 1998 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   9.4  $ */
  15.  
  16. #if !defined(__FCNTL_H)
  17. #define __FCNTL_H
  18.  
  19. #ifndef ___STDDEF_H
  20. #include <_stddef.h>
  21. #endif
  22.  
  23. #if !defined(RC_INVOKED)
  24.  
  25. #if defined(__STDC__)
  26. #pragma warn -nak
  27. #endif
  28.  
  29. #endif  /* !RC_INVOKED */
  30.  
  31. #ifdef __cplusplus
  32. namespace std {
  33. #endif /* __cplusplus */
  34.  
  35. #if defined(__cplusplus)
  36. extern "C" {
  37. #endif
  38. int _RTLENTRY _EXPFUNC _pipe(int *__phandles, unsigned int __psize, int __textmode);
  39. #if defined(__cplusplus)
  40. }
  41. #endif
  42.  
  43. extern int _RTLENTRY _fmode;
  44.  
  45. /* The first three can only be set by open */
  46.  
  47. #define O_RDONLY    0
  48. #define O_WRONLY    1
  49. #define O_RDWR      2
  50. #define O_ACCMODE   3       /* mask for file access modes */
  51.  
  52. /* Flag values for open only */
  53.  
  54. #define O_CREAT     0x0100  /* create and open file */
  55. #define O_TRUNC     0x0200  /* open with truncation */
  56. #define O_EXCL      0x0400  /* exclusive open */
  57.  
  58. /* The "open flags" defined above are not needed after open, hence they
  59.    are re-used for other purposes when the file is running.  Sorry, it's
  60.    getting crowded !
  61. */
  62. #define _O_RUNFLAGS 0x0700
  63. #define _O_WRITABLE 0x0100 /* file is not read-only */
  64. #define _O_EOF      0x0200 /* set when text file hits ^Z   */
  65.  
  66. /* a file in append mode may be written to only at its end.
  67. */
  68. #define O_APPEND    0x0800  /* to end of file */
  69.  
  70. /* MSDOS special bits */
  71.  
  72. #define O_CHANGED   0x1000  /* user may read these bits, but    */
  73. #define O_DEVICE    0x2000  /*   only RTL\io functions may touch.   */
  74. #define O_TEXT      0x4000  /* CR-LF translation    */
  75. #define O_BINARY    0x8000  /* no translation   */
  76.  
  77. /* DOS 3.x options */
  78.  
  79. #define O_NOINHERIT 0x80
  80. #define O_DENYALL   0x10
  81. #define O_DENYWRITE 0x20
  82. #define O_DENYREAD  0x30
  83. #define O_DENYNONE  0x40
  84.  
  85. #if defined(__MFC_COMPAT__)
  86. #define _O_APPEND      O_APPEND
  87. #define _O_BINARY      O_BINARY
  88. #define _O_CREAT       O_CREAT
  89. #define _O_EXCL        O_EXCL
  90. #define _O_NOINHERIT   O_NOINHERIT
  91. #define _O_RANDOM      O_RANDOM
  92. #define _O_RAW         O_BINARY
  93. #define _O_RDONLY      O_RDONLY
  94. #define _O_RDWR        O_RDWR
  95. #define _O_TEXT        O_TEXT
  96. #define _O_TRUNC       O_TRUNC
  97. #define _O_WRONLY      O_WRONLY
  98. #endif
  99.  
  100. #if !defined(RC_INVOKED)
  101.  
  102. #if defined(__STDC__)
  103. #pragma warn .nak
  104. #endif
  105.  
  106. #endif  /* !RC_INVOKED */
  107.  
  108. #ifdef __cplusplus
  109. } // std
  110. #endif /* __cplusplus */
  111.  
  112. #endif  /* __FCNTL_H */
  113.  
  114. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__FCNTL_H_USING_LIST)
  115. #define __FCNTL_H_USING_LIST
  116.     using std::_pipe;
  117.     using std::_fmode;
  118. #endif /* __USING_CNAME__ */
  119.